﻿<r:RibbonWindow x:Uid="eComicEditor" x:Class="MainWindow" x:Name="eComicEditor"
                xmlns:r="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
                xmlns:local="clr-namespace:eComicEditor"
                xmlns:lib="clr-namespace:LibraryFiles;assembly=LibraryFiles"
                Title="eComic Editor"  Background="White" ResizeMode="CanResizeWithGrip" Width="875"
                Height="800" AllowDrop="True" Icon="/eComicEditor;component/Resources/ecomEdit.ico" IconVisibility="Collapsed"
                Initialized="eComicEditor_Initialized"  >
    <r:RibbonWindow.Resources>
        <ResourceDictionary x:Uid="ResourceDictionary_1">
            <BooleanToVisibilityConverter x:Uid="BooleanToVisibilityConverter_1" x:Key="BoolToVis" />
            
            <r:RibbonCommand 
                x:Uid="r:RibbonCommand_1" x:Key="ExitApplicationCommand"
                Executed="ExitApplicationCommand_Executed" 
                LabelTitle="Exit"
                SmallImageSource="/LibraryFiles;component/Resources/exit21.png"
                LargeImageSource="/LibraryFiles;component/Resources/exit64.png"
                />
            <r:RibbonCommand 
                x:Uid="r:RibbonCommand_2" x:Key="OpenCommand" 
                Executed="OpenCommand_Executed"  
                LabelTitle="Open"
                ToolTipTitle="Open An Existing Archive"
                ToolTipDescription="Opens an existing archive for viewing"                
                LargeImageSource="/LibraryFiles;component/Resources/open32.png" 
                SmallImageSource="/LibraryFiles;component/Resources/open16.png" />
            <r:RibbonCommand x:Uid="r:RibbonCommand_3" x:Key="OpenDirCommand" Executed="OpenDirCommand_Executed" 
                             LabelTitle="Open Directory" ToolTipTitle="Open Directory" ToolTipDescription="Open a directory to view existing files"
                             SmallImageSource="/LibraryFiles;component/Resources/FolderOpen_24x24_72.png" LargeImageSource="/LibraryFiles;component/Resources/FolderOpen_48x48_72.png" />

            <r:RibbonCommand x:Uid="r:RibbonCommand_4" x:Key="SaveCommand" 
                             CanExecute="Savecommand_CanExecute" Executed="Savecommand_Executed" 
                             LabelTitle="Save" ToolTipTitle="Save" ToolTipDescription="When viewing a directory of images, the system can save the directory as a CBZ file."
                             SmallImageSource="/LibraryFiles;component/Resources/document-save-24.png" LargeImageSource="/LibraryFiles;component/Resources/document-save-64.png" />


            <r:RibbonCommand x:Uid="r:RibbonCommand_5" x:Key="OptionsCommand" Executed="OptionsCommand_Executed" 
                             LabelTitle="Options" 
                             SmallImageSource="/LibraryFiles;component/Resources/options_24.png" LargeImageSource="/LibraryFiles;component/Resources/options_64.png" />


        </ResourceDictionary>
    </r:RibbonWindow.Resources>
    <DockPanel x:Uid="DockPanel_1" >
        <r:Ribbon x:Uid="rbnMenu" x:Name="rbnMenu" DockPanel.Dock="Top"  Title="eComic Editor">
            <r:Ribbon.ApplicationMenu>
                <r:RibbonApplicationMenu x:Uid="r:RibbonApplicationMenu_1">
                <r:RibbonApplicationMenu.Footer>
                    <DockPanel x:Uid="DockPanel_2" LastChildFill="False">
                        <r:RibbonButton x:Uid="rbtExit" Name="rbtExit" Command="{StaticResource ExitApplicationCommand}" DockPanel.Dock="Right" />
                        <r:RibbonButton x:Uid="r:RibbonButton_1" Command="{StaticResource OptionsCommand}" DockPanel.Dock="Right" Margin="0,0,5,0" />
                    </DockPanel>
                </r:RibbonApplicationMenu.Footer>
                <r:RibbonApplicationMenu.RecentItemList>
                    <HeaderedContentControl x:Uid="HeaderedContentControl_1">
                        <HeaderedContentControl.Header>
                            <StackPanel x:Uid="StackPanel_1" Orientation="Vertical" >
                                <Label x:Uid="Label_1" Content="Recently Viewed Files" FontWeight="Bold" />
                                <Separator x:Uid="Separator_1" />
                            </StackPanel>
                        </HeaderedContentControl.Header>
                        <r:RibbonHighlightingList x:Uid="mruList" MostRecentFileSelected="mruList_MostRecentFileSelected" 
                                                    DisplayMemberPath="Name" Name="mruList" ItemsSource="{Binding MRU}"
                                                  />
                    </HeaderedContentControl>
                </r:RibbonApplicationMenu.RecentItemList>
                <r:RibbonApplicationMenu.Command>
                    <r:RibbonCommand x:Uid="r:RibbonCommand_6" LabelTitle="Application Button"
                                         LabelDescription="Close the application."
                                         LargeImageSource="/Resources/ecomEdit-001.png"
                                         ToolTipTitle="eComic-Sequential Image Viewer"
                                         ToolTipDescription="" />
                </r:RibbonApplicationMenu.Command>
                <r:RibbonApplicationMenuItem x:Uid="r:RibbonApplicationMenuItem_1" Command="{StaticResource OpenCommand}" />
                <r:RibbonApplicationMenuItem x:Uid="r:RibbonApplicationMenuItem_2" Command="{StaticResource OpenDirCommand}" />

                </r:RibbonApplicationMenu>
            </r:Ribbon.ApplicationMenu>

                <!-- Quick pick menu -->
            <r:Ribbon.QuickAccessToolBar>
                <r:RibbonQuickAccessToolBar x:Uid="r:RibbonQuickAccessToolBar_1" CanUserCustomize="True" >
                    <r:RibbonButton x:Uid="r:RibbonButton_2" Command="{StaticResource OpenCommand}" r:RibbonQuickAccessToolBar.Placement="InToolBar" />

                </r:RibbonQuickAccessToolBar>
            </r:Ribbon.QuickAccessToolBar>

            <r:RibbonTab x:Uid="r:RibbonTab_1" >
                <r:RibbonTab.Label >Home</r:RibbonTab.Label>
                <r:RibbonTab.Groups>
                    <r:RibbonGroup x:Uid="grpFileOps" x:Name="grpFileOps"  >
                        <r:RibbonButton x:Uid="r:RibbonButton_3" Command="{StaticResource OpenCommand}" />
                        <r:RibbonButton x:Uid="r:RibbonButton_4" Command="{StaticResource OpenDirCommand}" />
                        <r:RibbonButton x:Uid="r:RibbonButton_5" Command="{StaticResource SaveCommand}" />

                    </r:RibbonGroup>
                    <r:RibbonGroup x:Uid="grpOtherCmds" x:Name="grpOtherCmds">
                        <r:RibbonButton x:Uid="r:RibbonButton_6"  />
                        <r:RibbonButton x:Uid="r:RibbonButton_7"  />
                    </r:RibbonGroup>
                </r:RibbonTab.Groups>
            </r:RibbonTab> 
        
        </r:Ribbon>
        <StatusBar x:Uid="sbBott" Name="sbBott" DockPanel.Dock="Bottom" >
            <StatusBarItem x:Uid="StatusBarItem_1" Grid.Column="3">
                <ProgressBar x:Uid="prgLoading" Name="prgLoading" Height="12px" VerticalAlignment="Center" HorizontalAlignment="Right"  
                            Margin="0,0,10,0" Width="150px" />
            </StatusBarItem>
            
            <StatusBarItem x:Uid="StatusBarItem_2" Grid.Column="5" >
                <Button x:Uid="btnUpdate" Name="btnUpdate"  Visibility="{Binding Path=DisplayUpdate, Converter={StaticResource BoolToVis}}" 
                            Click="btnUpdate_Click"  ToolTip="An update is available. Click here to go to the site and download the latest version of eComic." >
                    <Button.Style>
                        <Style x:Uid="Style_1" TargetType="{x:Type Button}">
                            <Style.Setters>
                                <Setter x:Uid="Setter_1" Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate x:Uid="ControlTemplate_1" TargetType="{x:Type Button}">
                                            <ControlTemplate.Resources>
                                                <Storyboard x:Uid="Storyboard_1" x:Key="ShowShine">
                                                    <DoubleAnimationUsingKeyFrames x:Uid="DoubleAnimationUsingKeyFrames_1" BeginTime="00:00:00" Storyboard.TargetName="Shine" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame x:Uid="SplineDoubleKeyFrame_1" KeyTime="00:00:00.5000000" Value="1"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                                <Storyboard x:Uid="Storyboard_2" x:Key="HideShine">
                                                    <DoubleAnimationUsingKeyFrames x:Uid="DoubleAnimationUsingKeyFrames_2" BeginTime="00:00:00" Storyboard.TargetName="Shine" Storyboard.TargetProperty="(UIElement.Opacity)">
                                                        <SplineDoubleKeyFrame x:Uid="SplineDoubleKeyFrame_2" KeyTime="00:00:00.3000000" Value="0"/>
                                                    </DoubleAnimationUsingKeyFrames>
                                                </Storyboard>
                                            </ControlTemplate.Resources>

                                            <Border x:Uid="border1" Background="{TemplateBinding Background}" x:Name="border1" >
                                                <Grid x:Uid="Grid_1">
                                                    <Border x:Uid="Shine" Grid.Row="1" Opacity="0" x:Name="Shine" Width="Auto" Height="Auto" CornerRadius="0,0,5,5" Margin="1,0,-1,0" Background="{TemplateBinding BorderBrush}"/>
                                                    <Image x:Uid="Image_1" Source="Resources/update_recommended_24.png" Height="16" Width="16" MaxHeight="16" MaxWidth="16" Stretch="Uniform"
                                                               Margin="0,0,5,0" />
                                                </Grid>
                                            </Border>
                                            <ControlTemplate.Triggers>
                                                <Trigger x:Uid="Trigger_1" Property="IsEnabled" Value="False" >
                                                    <Setter x:Uid="Setter_2" Property="Opacity" TargetName="border1" Value="0.5" />
                                                </Trigger>
                                                <Trigger x:Uid="Trigger_2" Property="IsMouseOver" Value="True">
                                                    <Trigger.ExitActions>
                                                        <BeginStoryboard x:Uid="HideShine_BeginStoryboard" Storyboard="{StaticResource HideShine}" x:Name="HideShine_BeginStoryboard" />
                                                    </Trigger.ExitActions>
                                                    <Trigger.EnterActions>
                                                        <BeginStoryboard x:Uid="ShowShine_BeginStoryboard" x:Name="ShowShine_BeginStoryboard" Storyboard="{StaticResource ShowShine}" />
                                                    </Trigger.EnterActions>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style.Setters>
                        </Style>
                    </Button.Style>

                </Button>
            </StatusBarItem>
        </StatusBar>
        <TabControl x:Uid="tabContainer" Name="tabContainer">
            <TabItem x:Uid="TabItem_1">
                <TabItem.Header>Details</TabItem.Header>
            </TabItem>
            <TabItem x:Uid="TabItem_2">
                <TabItem.Header>Image List</TabItem.Header>
                <DockPanel x:Uid="DockPanel_3">
                    <ListView x:Uid="lsvImages" Name="lsvImages" ItemsSource="{Binding Path=Pages}"   >
                        <ListView.View>
                            <lib:ImageView x:Uid="lib:ImageView_1" />
                        </ListView.View>
                    </ListView>
                </DockPanel>
            </TabItem>
            <TabItem x:Uid="TabItem_3">
                <TabItem.Header>Page Details</TabItem.Header>
                <Grid x:Uid="Grid_2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition x:Uid="ColumnDefinition_1" Width="3*" />
                        <ColumnDefinition x:Uid="ColumnDefinition_2" Width="5*" />
                    </Grid.ColumnDefinitions>
                </Grid>
            </TabItem>
        </TabControl>
    </DockPanel>
</r:RibbonWindow>
